package org.webcamp.settings.services.impl;

import org.webcamp.settings.dao.SettingsDao;
import org.webcamp.settings.dto.Settings;
import org.webcamp.settings.services.SettingsService;

public class SettingsServiceImpl implements SettingsService {

	private SettingsDao settingsDao;

	public void setSettingsDao(SettingsDao settingsDao) {
		this.settingsDao = settingsDao;
	}

	@Override
	public Settings loadSettings() {
		return settingsDao.loadSettings();
	}

	@Override
	public void setSettings(String name, String value) {
		Settings s = settingsDao.loadSettings();
		s.setSetting(name, value);
		settingsDao.saveSettings(s);
	}

}
